package practice;

import java.util.Arrays;

/**
 * @Description: https://leetcode.cn/problems/meeting-rooms/
 * @Author Ammar
 * @Create 2023/7/21 21:29
 */
public class _252_会议室 {
    public boolean canAttendMeetings(int[][] intervals) {
        if (intervals.length == 0) return true;
        Arrays.sort(intervals, (m1, m2) -> m1[0] - m2[0]);

        for (int i = 1; i < intervals.length; i++) {
            if (intervals[i][0] < intervals[i - 1][1]) return false;
        }
        return true;
    }
}
